<script>
import comMixin from "./comMixin.js";
import { isNumber } from "lodash";
export default {
  mixins: [comMixin],
  props: {
    rows: {
      type: Number | String,
      default: 3,
    },
    width: {
      type: String | Number,
      default: "90%",
    },
    height: {
      type: String | Number,
      default: "initial",
    },
  },
  render() {
    const formatNumber = (c) => (isNumber(c) ? `${c}vw` : c);
    const style = `width:${formatNumber(this.width)};height:${formatNumber(
      this.height
    )}vw`;
    return (
      <el-input
        style={style}
        type="textarea"
        class="aoneui-textarea"
        v-model={this.formData[this.prop]}
        placeholder={this.placeholderSync}
        clearable={true}
        rows={this.rows}
      ></el-input>
    );
  },
};
</script>